package com.mck.service.impl;

import com.mck.mapper.BackgroundColorMapper;
import com.mck.entity.BackgroundColor;
import com.mck.service.BackgroundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.List;

@Service
public class BackgroundColorImpl implements BackgroundService {

    @Autowired
    private BackgroundColorMapper backgroundColorMapper;

    /**
     * 获取背景颜色
     */
    @Override
    public List<BackgroundColor> getBackgroundColor() {
        return backgroundColorMapper.getBackgroundColor();
    }

    /**
     * 更新背景颜色
     */
    @Override
    public void updateBackgroundColor(BackgroundColor backgroundColor) {
        backgroundColor.setUpdateTime(LocalDate.now());

        backgroundColorMapper.updateBackgroundColor(backgroundColor);
    }
}
